package controllers;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.io.Serializable;

import boundarys.CreateProductGUI;
import ccrm.BoundryControl;
import ccrm.ClientMain;
import entitys.Product;
import entitys.Request;
import entitys.Session;
import enums.*;
public class CreateProductController {

	/**
	 * Send request to server to add Product.
	 */
	public static Result addProduct(String name, String desc, String pic,float price)
	{
		Request r =new Request(Command.ADD_PRODUCT,Session.getEmployee().getUserId(),new Product(name, desc, pic, price));

		try {
			ClientMain.client.sendToServer(r);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		return Result.OK;	
	}
	
	
}
